package com.fyyg.common.ssc;

import java.io.Serializable;
import java.util.Date;

/**
 * 时时彩对象
 *
 * @author hang.ouyang
 * @date 2016-04-21 11:00
 */
public class SSCObject implements Serializable {


    private String expect;//期数
    private String opencode;//开奖码
    private String opentime;//开奖时间
    private String opentimestamp;

    public String getExpect() {
        return expect;
    }

    public void setExpect(String expect) {
        this.expect = expect;
    }

    public String getOpencode() {
        return opencode;
    }

    public void setOpencode(String opencode) {
        this.opencode = opencode;
    }

    public String getOpentime() {
        return opentime;
    }

    public void setOpentime(String opentime) {
        this.opentime = opentime;
    }

    public String getOpentimestamp() {
        return opentimestamp;
    }

    public void setOpentimestamp(String opentimestamp) {
        this.opentimestamp = opentimestamp;
    }

    public Integer getCode(){
        if(getOpencode() == null )
            return 0;
        return Integer.parseInt(getOpencode().replace(",","")) ;
    }

    @Override
    public String toString() {
        return "SSCObject{" +
                "expect='" + expect + '\'' +
                ", opencode='" + opencode + '\'' +
                ", opentime='" + opentime + '\'' +
                ", opentimestamp='" + opentimestamp + '\'' +
                '}';
    }

    public static SSCObject emptyObject(){
        SSCObject sscObject = new SSCObject();
        sscObject.setOpencode("0,0,0,0,0");
        sscObject.setExpect(null);
        sscObject.setOpentime(null);
        sscObject.setOpentimestamp(null);
        return sscObject;
    }

}
